package com.sali.a_pre_knowledge.lesson_interface_program.lesson_01;

import com.sali.design_pattern.c_factory_method_pattern.lesson_03.pojo.User;

import java.util.ArrayList;
import java.util.List;

/**
 * @description: 原始Demo
 * @date: 2022/11/13 17:00.
 * @version: 1.0
 */
public class DrawControllerTest {

    public static void main(String[] args) {
        List<User> list = new ArrayList<>();
        list.add(new User("小章", 11));
        list.add(new User("小白", 351));
        list.add(new User("小红", 13));
        list.add(new User("小花", 12));
        list.add(new User("小乖", 132));
        DrawController drawController = new DrawController();
        //随机
        List<User> list1 = drawController.doRandomUser(list, 3);
        System.out.println("随机的方式:");
        list1.forEach(System.out::println);
        //权重方式
        List<User> list2 = drawController.doWeightUser(list, 3);
        System.out.println("权重的方式:");
        list2.forEach(System.out::println);
    }

}
